/*     */ package com.umeng.newxp.controller;
/*     */ 
/*     */ import android.app.AlertDialog;
/*     */ import android.app.Dialog;
/*     */ import android.content.ActivityNotFoundException;
/*     */ import android.content.Context;
/*     */ import android.content.Intent;
/*     */ import android.content.res.Resources;
/*     */ import android.net.Uri;
/*     */ import android.widget.Toast;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.common.util.h;
/*     */ import com.umeng.newxp.Promoter;
/*     */ import com.umeng.newxp.Promoter.a;
/*     */ import com.umeng.newxp.a.d;
/*     */ import com.umeng.newxp.common.ExchangeConstants;
/*     */ import com.umeng.newxp.common.g;
/*     */ import com.umeng.newxp.net.XpReportClient;
/*     */ import com.umeng.newxp.net.e;
/*     */ import com.umeng.newxp.net.e.a;
/*     */ import com.umeng.newxp.view.LandingWebViewDialog;
/*     */ import com.umeng.newxp.view.aK;
/*     */ import com.umeng.newxp.view.aw;
/*     */ import com.umeng.newxp.view.o;
/*     */ import com.umeng.newxp.view.o.a;
/*     */ 
/*     */ public class b
/*     */ {
/*     */   public static void a(Promoter paramPromoter, Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt, boolean paramBoolean)
/*     */   {
/*  48 */     a(new a.a(paramPromoter, 0), paramContext, paramExchangeDataService, paramInt, 
/*  49 */       paramBoolean, 0);
/*     */   }
/*     */ 
/*     */   public static void a(a.a parama, Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, boolean paramBoolean, int paramInt2)
/*     */   {
/*  63 */     Promoter localPromoter = parama.a;
/*     */ 
/*  67 */     if (com.umeng.common.b.a(localPromoter.app_package_name, paramContext)) {
/*  68 */       d(paramContext, paramExchangeDataService, paramInt1, localPromoter, paramInt2);
/*  69 */       return;
/*     */     }
/*     */ 
/*  75 */     Uri localUri = Uri.parse(localPromoter.url);
/*  76 */     String str1 = localUri.getScheme();
/*  77 */     if ((str1 != null) && (str1.equalsIgnoreCase(Promoter.a.a.toString()))) {
/*  78 */       String str2 = localUri.getAuthority();
/*  79 */       ExchangeDataService localExchangeDataService = new ExchangeDataService(str2);
/*  80 */       localExchangeDataService.layoutType = 7;
/*  81 */       aw.a(paramContext, localExchangeDataService, null, null);
/*  82 */       return;
/*     */     }
/*     */ 
/*  88 */     if ((str1 != null) && (str1.equalsIgnoreCase(Promoter.a.b.toString()))) {
/*  89 */       a(parama, paramContext, paramExchangeDataService, paramInt1, localPromoter, paramInt2);
/*  90 */       return;
/*     */     }
/*     */ 
/*  93 */     int i = localPromoter.landing_type;
/*  94 */     if ((paramBoolean) && (i == 0)) {
/*  95 */       i = 1;
/*     */     }
/*     */ 
/*  98 */     switch (i) {
/*     */     case 2:
/*     */     case 4:
/* 101 */       c(paramContext, paramExchangeDataService, paramInt1, localPromoter, paramInt2);
/* 102 */       return;
/*     */     case 3:
/* 104 */       b(paramContext, paramExchangeDataService, paramInt1, localPromoter, paramInt2);
/* 105 */       return;
/*     */     case 1:
/* 107 */       a(paramContext, paramExchangeDataService, paramInt1, localPromoter, paramInt2);
/* 108 */       return;
/*     */     case 0:
/* 111 */       b(parama, paramContext, paramExchangeDataService, paramInt1, localPromoter, 
/* 112 */         paramInt2);
/* 113 */       return;
/*     */     }
/*     */   }
/*     */ 
/*     */   private static void a(a.a parama, Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 121 */     e locale = new e.a(paramContext)
/* 122 */       .a(2).b(paramInt2)
/* 123 */       .d(3).c(paramInt1).a(new Promoter[] { paramPromoter })
/* 124 */       .d(paramExchangeDataService.getTimeConsuming())
/* 125 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId)
/* 126 */       .a();
/* 127 */     new XpReportClient(paramContext).sendAsync(locale, null);
/*     */ 
/* 129 */     Resources localResources = paramContext.getResources();
/* 130 */     String str = paramContext.getPackageName();
/* 131 */     int i = localResources.getIdentifier("umeng_xp_dialog_download_window", "style", 
/* 132 */       str);
/* 133 */     o localo = new o(paramContext, paramPromoter, paramInt1, parama.b, 
/* 134 */       paramExchangeDataService, i, o.a.b);
/* 135 */     localo.show();
/*     */   }
/*     */ 
/*     */   private static void b(a.a parama, Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 141 */     if (1 > d.o(paramContext)) {
/* 142 */       Log.e(ExchangeConstants.LOG_TAG, "no resource open download dialog.");
/* 143 */       a(paramContext, paramExchangeDataService, paramInt1, paramPromoter, paramInt2);
/* 144 */       return;
/*     */     }
/*     */ 
/* 147 */     e locale = new e.a(paramContext)
/* 148 */       .a(2).b(paramInt2)
/* 149 */       .d(3).c(paramInt1).a(new Promoter[] { paramPromoter })
/* 150 */       .d(paramExchangeDataService.getTimeConsuming())
/* 151 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId)
/* 152 */       .a();
/* 153 */     new XpReportClient(paramContext).sendAsync(locale, null);
/*     */     Object localObject;
/* 155 */     if (ExchangeConstants.USE_SIMPLE_DIALOG) {
/* 156 */       localObject = new aK(paramContext, paramPromoter, paramInt1, 
/* 157 */         parama.b, paramExchangeDataService);
/* 158 */       ((AlertDialog)localObject).show();
/*     */     } else {
/* 160 */       localObject = paramContext.getResources();
/* 161 */       String str = paramContext.getPackageName();
/* 162 */       int i = ((Resources)localObject).getIdentifier("umeng_xp_dialog_download_window", "style", 
/* 163 */         str);
/* 164 */       o localo = new o(paramContext, paramPromoter, paramInt1, parama.b, 
/* 165 */         paramExchangeDataService, i, o.a.a);
/* 166 */       localo.show();
/*     */     }
/*     */   }
/*     */ 
/*     */   private static void a(Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 172 */     e.a locala = new e.a(paramContext)
/* 173 */       .a(7)
/* 174 */       .b(paramInt2).d(3).c(paramInt1)
/* 175 */       .a(new Promoter[] { 
/* 175 */       paramPromoter })
/* 176 */       .d(paramExchangeDataService.getTimeConsuming())
/* 177 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId);
/* 178 */     new com.umeng.newxp.net.c(paramContext, paramPromoter, locala).a();
/*     */   }
/*     */ 
/*     */   private static void b(Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 183 */     e locale = new e.a(paramContext)
/* 184 */       .a(2).b(paramInt2)
/* 185 */       .d(3).c(paramInt1).a(new Promoter[] { paramPromoter })
/* 186 */       .d(paramExchangeDataService.getTimeConsuming())
/* 187 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId)
/* 188 */       .a();
/* 189 */     new XpReportClient(paramContext).sendAsync(locale, null);
/*     */     try
/*     */     {
/* 192 */       Uri localUri = Uri.parse(paramPromoter.url);
/* 193 */       Intent localIntent = new Intent("android.intent.action.VIEW", localUri);
/* 194 */       paramContext.startActivity(localIntent);
/*     */     } catch (ActivityNotFoundException localActivityNotFoundException) {
/* 196 */       Log.b(ExchangeConstants.LOG_TAG, localActivityNotFoundException.toString());
/* 197 */       Toast.makeText(paramContext, paramContext.getString(com.umeng.common.c.a(paramContext).g("umeng_xp_no_browser_tips")), 0).show();
/*     */     }
/*     */   }
/*     */ 
/*     */   private static void c(Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 203 */     if (1 > d.r(paramContext)) {
/* 204 */       Log.e(ExchangeConstants.LOG_TAG, "no resource open native webview.");
/* 205 */       b(paramContext, paramExchangeDataService, paramInt1, paramPromoter, paramInt2);
/* 206 */       return;
/*     */     }
/* 208 */     e locale = new e.a(paramContext)
/* 209 */       .a(2).b(paramInt2)
/* 210 */       .d(3).c(paramInt1).a(new Promoter[] { paramPromoter })
/* 211 */       .d(paramExchangeDataService.getTimeConsuming())
/* 212 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId)
/* 213 */       .a();
/* 214 */     new XpReportClient(paramContext).sendAsync(locale, null);
/* 215 */     new LandingWebViewDialog(paramContext, paramPromoter.url).show();
/*     */   }
/*     */ 
/*     */   private static void d(Context paramContext, ExchangeDataService paramExchangeDataService, int paramInt1, Promoter paramPromoter, int paramInt2)
/*     */   {
/* 220 */     e locale = new e.a(paramContext)
/* 221 */       .a(5)
/* 222 */       .b(paramInt2).d(0).c(paramInt1)
/* 223 */       .a(new Promoter[] { 
/* 223 */       paramPromoter })
/* 224 */       .d(paramExchangeDataService.getTimeConsuming())
/* 225 */       .b(g.a(paramContext, paramExchangeDataService)).a(paramExchangeDataService.slot_id).c(paramExchangeDataService.sessionId)
/* 226 */       .a();
/* 227 */     new XpReportClient(paramContext).sendAsync(locale, null);
/*     */ 
/* 229 */     if (!h.d(paramPromoter.url_in_app)) h.b(paramContext, 
/* 230 */         paramPromoter.url_in_app);
/*     */     else
/* 232 */       h.a(paramContext, paramPromoter.app_package_name);
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.newxp.controller.b
 * JD-Core Version:    0.6.2
 */